<?php
/***************************************************************************
 *                                commondefs.php
 *                            -------------------
 *                      (APU) Automated Pilot Utility
 *   begin                : Sunday, Nov 19, 2006
 *   copyright            : (C) 2004-2006 SF Games
 *   email                : techsupport@sf-games.com
 *
 * The below used to be in common.php, however due to php strangness
 * it is now in a seperate file. When below was in common.php and was
 * inlcuded in a file, values would not be seen in functions. Including
 * common.php again in a function would cause a redefinition error on
 * the functions in common.php, but still no values are seen.
 *
 * common.php includes this file.
 ***************************************************************************/

	// Maximum string lengths for security, safety, and sanity
	// These need to match the set CHAR lengths present in the PILOTS database table
	// And submission form max lengths.
	static $MAX_FIRST_NAME_LENGTH    = 30;
	static $MAX_LAST_NAME_LENGTH     = 40;
	static $MAX_EMAIL_LENGTH         = 50;
	static $MAX_PASSWORD_LENGTH      = 40;
	static $MAX_COMMENTS_LENGTH      = 255;
	static $MAX_ID_LENGTH            = 15;
	static $MAX_DATE_LENGTH          = 10;
	static $MAX_AIRPORT_ID           = 4;
	static $MAX_TIME_LENGTH          = 4;
	static $MAX_EMAIL_SUBJECT_LENGTH = 80;
	static $MAX_EMAIL_MESSAGE_LENGTH = 1000;
	static $MAX_OTHER_LENGTH         = 50;

	// APU started here on this year
	// Used by code needing to know when APU tracking began
	// Example, for filling out drop down controls with years
	static $APU_START_YEAR        = 2004;

	static $APU_VERSION           = "2.0";
	$APU_COPYRIGHT         = "(APU) Automated Pilot Utility. Version " .$APU_VERSION ." Copyright &copy; 2004-" .getCurrentYear() ." <a target=\"_blank\" href=\"http://www.sf-games.com\">SF Games</a>";

   /***************************************************************************
    *   Useful arrays
    ***************************************************************************/

	$monthsArrayNum   = array(0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
	$monthsArrayShort = array("Err", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	$monthsArrayFull  = array("NA", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
	$PirepArray       = array("PILOTS" => 0, "PIREPS" => 0, "PAX" => 0, "CARGO" => 0, "FUEL_BURNED" => 0, "FLIGHT_HRS" => "0.0", "COMMENTS" => "none");
	$FlightTimeArray  = array("TOTAL" => "", "FIXED_WING" => true, "HELO" => false, "DAY" => "", "NIGHT" => "", "VFR" => "", "IFR" => "");
	$PromotionArray   = array("PROMOTION_A" => false, "PROMOTION_H" => false, "PROMOTION_RANK" => 0);
?>
